<template>
  <page-body>
    <view class="page">
      <view class="flex align-stretch benben-position-layout flex home_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex align-center justify-between flex-sub home_fd0_0'>
          <view class='flex flex-wrap align-center home_fd0_0_c0'>
            <view class='flex align-center justify-center home_fd0_0_c0_c0'>
            </view>
          </view>
          <view class='flex align-center'>
            <view>
              <benben-flex-tabs class-name='home_benbenTabsfd0_0_c1_c0' v-model="tabsTypefd0_0_c1_c0"
                ref="benben_tabsfd0_0_c1_c0" select-mark="benben_tabsfd0_0_c1_c0" key="benben_tabsfd0_0_c1_c0"
                :open-title-type='false' :open-sticky='false' :top='0' :is-show-content='false' :scrollspy='false'
                :tabs-info.sync="tabsInfofd0_0_c1_c0">

                <scroll-view @scroll="tabsInfofd0_0_c1_c0.scrollX = $event.detail.scrollLeft"
                  id="benben_tabsfd0_0_c1_c0" class="benben-tabs" style="width:300rpx" :scroll-x="true"
                  :scroll-left.sync="tabsInfofd0_0_c1_c0.moveX" scroll-with-animation="all .3s ease">
                  <view class="benben-tabs-content" id="benben_tabsfd0_0_c1_c0-content">
                    <view id="benben_tabsfd0_0_c1_c0-title"
                      class="benben-tabs-title flex flex align-center justify-around">
                      <view
                        :class="{ 'checkTitlefd0_0_c1_c0': tabsTypefd0_0_c1_c0 == '1', 'flex flex-wrap align-center': true }"
                        @tap="chengTab('1')" :id="`benben_tabsfd0_0_c1_c0-title-item-${'1'}`">

                        <text>动态</text>

                      </view>
                      <view
                        :class="{ 'checkTitlefd0_0_c1_c0': tabsTypefd0_0_c1_c0 == '2', 'flex flex-wrap align-center': true }"
                        @tap="chengTab('2')" :id="`benben_tabsfd0_0_c1_c0-title-item-${'2'}`">

                        <text>发明</text>

                      </view>
                      <view
                        :class="{ 'checkTitlefd0_0_c1_c0': tabsTypefd0_0_c1_c0 == '3', 'flex flex-wrap align-center': true }"
                        @tap="chengTab('3')" :id="`benben_tabsfd0_0_c1_c0-title-item-${'3'}`">

                        <text>二手</text>

                      </view>
                    </view>
                    <view :style="{ left: tabsInfofd0_0_c1_c0.lineleft, maxWidth: tabsInfofd0_0_c1_c0.lineWidth ,}"
                      id="benben_tabsfd0_0_c1_c0-line"
                      class="benben-tabs-line flex benben-flex-tabs-line home_linefd0_0_c1_c0"></view>
                  </view>
                </scroll-view>

              </benben-flex-tabs>

            </view>
          </view>
          <view class='flex align-center justify-end'>
            <view class='flex flex-wrap align-center justify-center home_fd0_0_c0_c0'>
            </view>
            <view class='flex flex-wrap align-center justify-center home_fd0_0_c2_c1' @tap.stop="handleJumpDiy"
              data-type="navigateTo" :data-url="`/pages/homePage/searchye/searchye`">
              <image class='home_fd0_0_c2_c1_c0' mode="aspectFit" :src='STATIC_URL+"170.png"'></image>
            </view>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---flex布局flex布局开始-->
      <view class="flex benben-flex-layout flex-wrap align-center home_flex_1">
        <view style="position: relative">
          <swiper ref="benbenSwiperfd1_0" @change="bannerIndexfd1_0 = $event.detail.current"
            class='flex position-relative home_fd1_0' previous-margin="0rpx" next-margin="0rpx"
            :display-multiple-items="1" :interval="5000" :duration="500" :autoplay='true' :circular='true'>
            <swiper-item class='flex  home_fd1_0_c2' v-for="(item,index) in bannerList" :key="index"
              @tap.stop="handleJumpDiy" data-type="navigateTo"
              :data-url="`/pages/grzx/patentapplication/patentapplication`">
              <image class='home_fd1_0_c2_c0' mode="aspectFill" :src='item.thumb'></image>
            </swiper-item>


          </swiper>
          <view style="position: absolute" class="flex dot flex align-center justify-center home_swiperDotfd1_0">
            <view class='flex flex align-center justify-center home_numberfd1_0_c0'>
              <text>{{bannerIndexfd1_0+1}}</text>
              <text>/</text>
              <text>{{(bannerList.length)}}</text>
            </view>

          </view>
        </view>
      </view>

      <!---flex布局flex布局结束-->
      <!---flex布局flex布局开始-->
      <view class="flex benben-flex-layout flex-wrap align-center home_flex_2">
        <view class='flex flex-wrap align-center home_fd2_0' v-for="(item,index) in dataList" :key="index"
          @tap.stop="handleJumpDiy" data-type="navigateTo" :data-url="`/pages/homePage/detail/detail?aid=${item.aid}`">
          <image class='home_fd2_0_c0' mode="aspectFill" :src='item.picture[0]'></image>
          <view class='flex flex-direction flex-wrap align-stretch home_fd2_0_c1'>
            <text class='home_fd2_0_c1_c0'>{{item.title}}</text>
            <view class='flex flex-wrap align-center justify-between home_fd2_0_c1_c1'>
              <text class='home_fd2_0_c1_c1_c0'>{{item.exhibition_name}}</text>
              <view class='flex flex-wrap align-center'>
                <text class='home_fd2_0_c1_c1_c1_c0'>{{item.viewcount}} 浏览</text>
              </view>
            </view>
          </view>
        </view>
        <fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData"
          :listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
      </view>

      <!---flex布局flex布局结束-->


    </view>
    <benben-popup v-model="popupShow1679541357000" :mask="true" :mask-close-able="true" mode='center'>
      <!---清除缓存flex布局开始-->
      <view class="flex flex-direction flex-wrap align-center system_flex_4" @tap.stop="popupShow1650940432200=true">
        <view class='system_fd4_0'>通知公告</view>
        <view class='system_fd4_1'>这是一段公告文字这是一段公告文字这是一段公告文字这是一段公告文字这是一段公告文字这是一段公告文字这是一段公告文字这是一段公告文字</view>
        <button class='system_fd4_2_c1' @tap.stop="cleanUpFunc()">知道了</button>
      </view>

      <!---清除缓存flex布局结束-->

    </benben-popup>
  </page-body>
</template>
<script>
  import pagingList from '@/common/mixin/paging_list.js';
  import {
    validate
  } from '@/common/utils/validate.js'
  // 11111111111111111111
  import {
    TUILogin
  } from "@tencentcloud/tui-core";
  import {
    SYSTEM_CONFIG,
    SDKAppID,
    secretKey
  } from "@/common/config.js";
  import {
    TUIChatKit,
    genTestUserSig
  } from "@/TUIKit";
  import {
    vueVersion
  } from "@/TUIKit/adapter-vue";
  // 22222222222222222222222222
  export default {
    components: {},
    mixins: [pagingList],

    data() {
      return {
        popupShow1679541357000: false,
        "bannerIndexfd1_0": 0,
        "tabsInfofd0_0_c1_c0": {
          lineleft: '',
          lineWidth: '',
          moveX: 0,
          scrollX: 0,
          PageScrollX: 0
        },
        "tabsTypefd0_0_c1_c0": "1",
        "minixPagingListsApi": "",
        "pageingListApiMethod": "",
        "allowOnloadGetList": false,
        "bannerList": [],
        "curent": "",
        "dataList": []
      };
    },
    computed: {
      isLogin() {
        return this.$store.state.token == '' ? false : true;
      },
      userInfo: {
        get() {
          return this.$store.state.userInfo
        },
        set() {
          this.$store.commit('updateUserInfo', value)
        },
      }
    },
    watch: {},
    onLoad(options) {
      if (global.appTabBarType) this.toHomeDiy()
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {
      this.getlk415752f56d0fFunc()
      this.gette698cbe11f907Func()
      if (this.isLogin) {
        const userID = this.userInfo ? this.userInfo.id.toString() : '';
        let config = {
          userID: userID, //User ID
          SDKAppID: SDKAppID, // Your SDKAppID
          secretKey: secretKey, // Your secretKey
        }
        const userSig = genTestUserSig(config).userSig;
        TUILogin.login({
          SDKAppID: config.SDKAppID,
          userID: config.userID,
          userSig: userSig,
          // 如果您需要发送图片、语音、视频、文件等富媒体消息，请设置为 true
          useUploadPlugin: true,
          useProfanityFilterPlugin: false,
          framework: `vue${vueVersion}` // 当前开发使用框架 vue2 / vue3
        }).then(() => {
          let nums = uni.$TIM.getTotalUnreadMessageCount();
          if (nums) {
            uni.setTabBarBadge({
              index: 2,
              text: nums.toString()
            })
          }

        })
      } else {
        uni.removeTabBarBadge({
          index: 2
        })
      }
    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      //系统文章-获取平台公告列表
      async getlk415752f56d0fFunc() {
        //请求方法
        //数据验证

        let databannerList = await this.$api.get(global.apiUrls.post6415752f56d0f, {

        });

        if (databannerList.data.code != 1) {
          this.$message.info(databannerList.data.msg);
          return
        }
        let infobannerList = databannerList.data.data;
        this.bannerList = infobannerList.data

      },
      chengTab(type) {
        this.tabsTypefd0_0_c1_c0 = type
        this.gette698cbe11f907Func()
      },
      //查询动态列表
      gette698cbe11f907Func() {
        this.minixPagingListsApi = global.apiUrls.post6698cbe11f907;
        this.pageingListApiMethod = 'post';
        this.allowOnloadGetList = false;
        this.pagingListPostDataContent = {
          freetransactionclassification_id: this.tabsTypefd0_0_c1_c0
        }
        this.listData = [];
        this.dataList = this.listData;
        this.pagingListToggle();

      },
      pagingListPostData() {
        return this.pagingListPostDataContent
      }
    }
  };
</script>
<style lang="scss" scoped>
  .system_flex_4 {
    background: #fff;
    width: 580rpx;
    border-radius: 16rpx 16rpx 16rpx 16rpx;
    padding: 24rpx;
  }

  .system_fd4_2_c1 {
    width: 276rpx;
    height: 72rpx;
    background: linear-gradient(180deg, #176BE8 0%, #5A5CFC 100%);
    border-radius: 40rpx;
    line-height: 72rpx;
    color: #FFF;
    font-size: 28rpx;
  }

  .system_fd4_2_c0 {
    border-top: 1px solid #eee;
    background: #fff;
    line-height: 110rpx;
    border-radius: 0rpx 0rpx 0rpx 16rpx;
    font-size: 32rpx;
    height: 110rpx;
    color: rgba(153, 153, 153, 1);
    padding: 0rpx 103rpx 0rpx 103rpx;
  }

  .system_fd4_2 {
    margin: 37rpx 0rpx 0rpx 0rpx;
  }

  .system_fd4_1 {
    line-height: 44rpx;
    font-size: 32rpx;
    font-weight: 500;
    color: #333333;
    margin: 24rpx 0
  }

  .system_fd4_0 {
    font-size: 36rpx;
    font-weight: 800;
    line-height: 44rpx;
    color: #333333;
    margin: 40rpx 0rpx 40rpx 0rpx;
  }

  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: url(image-path('169.png')) no-repeat;
    background-size: 100% auto;
  }

  .home_flex_0 {
    background: url(image-path('169.png')) no-repeat;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .home_fd0_0_c2_c1_c0 {
    width: 40rpx;
    height: 40rpx;
  }

  .home_fd0_0_c2_c1 {
    width: 50rpx;
    height: 50rpx;
    margin: 0rpx 0rpx 0rpx 32rpx;
  }

  .home_linefd0_0_c1_c0 {
    background: url(image-path('161.png')) no-repeat;
    width: 50rpx;
    height: 10rpx;
    top: 65rpx;
    background-size: 100% auto !important;
  }

  .checkTitlefd0_0_c1_c0 {
    font-weight: 700 !important;
    font-size: 36rpx !important;
    color: #333 !important;
  }

  ::v-deep .home_benbenTabsfd0_0_c1_c0 {
    width: 300rpx;
    height: 90rpx;
    white-space: nowrap;
    text-align: center;
    color: rgba(102, 102, 102, 1);
    font-size: 32rpx;
  }

  .home_fd0_0_c0_c0 {
    width: 50rpx;
    height: 50rpx;
  }

  .home_fd0_0_c0 {
    width: 132rpx;
  }

  .home_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
    line-height: 88rpx;
  }

  .home_flex_1 {
    width: 702rpx;
    margin: 24rpx auto 24rpx auto;
  }

  .home_numberfd1_0_c0 {
    background: #525050;
    position: absolute;
    bottom: 20rpx;
    right: 30rpx;
    width: 80rpx;
    height: 40rpx;
    border-radius: 6rpx 6rpx 6rpx 6rpx;
    font-size: 24rpx;
    color: #FFFFFF;
    line-height: 46rpx;
    font-weight: 400;
  }

  .home_fd1_0_c2 {
    background: var(--benbenbgColor1);
    background-size: 100% auto;
    height: 340rpx;
  }

  .home_fd1_0_c2_c0 {
    width: 100%;
    height: 100%;
  }

  .home_fd1_0_c1_c0 {
    width: 702rpx;
    height: 300rpx;
    border-radius: 10rpx 10rpx 10rpx 10rpx;
  }

  .home_fd1_0 {
    width: 702rpx;
    height: 300rpx;
  }

  .home_swiperDotUnselectedfd1_0 {
    border: 1px solid rgba(0, 0, 0, 0.3);
    background: rgba(0, 0, 0, 0.3);
    width: 16rpx;
    height: 16rpx;
    border-radius: 100rpx 100rpx 100rpx 100rpx;
    margin: 0rpx 6rpx 0rpx 0rpx;
    font-size: 24rpx;
    color: #fff;
  }

  .home_swiperDotSelectedfd1_0 {
    border: 1px solid #00A7FF;
    background: #00A7FF;
    width: 16rpx;
    height: 16rpx;
    border-radius: 100rpx 100rpx 100rpx 100rpx;
    margin: 0rpx 6rpx 0rpx 0rpx;
    font-size: 24rpx;
    color: #fff;
  }

  ::v-deep .home_swiperDotfd1_0 {
    position: absolute;
    bottom: 20rpx;
    left: 0rpx;
    right: 0rpx;
  }

  .home_flex_2 {
    margin: 0rpx auto 0rpx auto;
    width: 702rpx;
  }

  .home_fd2_0_c1_c1_c1_c0 {
    font-size: 24rpx;
    color: rgba(153, 153, 153, 1);
  }

  .home_fd2_0_c1_c1_c0 {
    font-weight: 600;
    color: rgba(255, 72, 59, 1);
  }

  .home_fd2_0_c1_c1 {
    margin: 24rpx 0rpx 0rpx 0rpx;
  }

  .home_fd2_0_c1_c0 {
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    height: 80rpx;
  }

  .home_fd2_0_c1 {
    margin: 24rpx auto 20rpx auto;
    width: 320rpx;
  }

  .home_fd2_0_c0 {
    width: 346rpx;
    height: 346rpx;
    border-radius: 16rpx 16rpx 0rpx 0;
  }

  .home_fd2_0 {
    background: #FFFFFF;
    border-radius: 16rpx 16rpx 16rpx 16rpx;
    width: 346rpx;
    margin: 16rpx 0 0rpx 0;
  }

  .home_fd2_0:nth-child(2n) {
    margin: 16rpx 0rpx 0rpx 10rpx;
  }
</style>
